---
title: web-apps-structural-reasoning
date: 2021-07-17 14:42:06
tags: php, web, python
---

While doing the web apps projects, I quickly realized that I, fortuitously, had come upon a template project structure, that I think is well suited to this type of project.  
In the very beginning of these projects, I was still trying to understand what would be the substitute of Python in the web world; as the tools I knew, cursorly, HTML and CSS, did nothing.  
I fell, hard, for PHP, that uncool, unhip but with an enormous amount of charisma and "laidbackness", that make them a perfect tool for anxious people.  
I was also positively impressed by how easy I could port my knowledge of PYthon and its syntax to this new language. So it was very much love at first site. Much in
the same way as my relationship stands with Javascript. Which I maintain is not a language, but the world's most elaborated practical joke.  
If my use of PHP would continue, some patterns would necessarily emerge.  
1. Database Calls. Their structure is almost always the same. They may differ if the call has something to show or not; but the need to create:
- a form to interact with the database,
- a action page to host the PHP code, proper,
- a page where this items would be injected through "request" tags,
- and finally but not the least, one css file to rule them all.  
So, at the moment, the template structure is this:



+---------------+
| Project Folder|
+---------------+
       |
       |              +-----+
       +--------------| CSS |
       |              +-----+
       |                 |
       |                 +-------------- > index.css
       |
       |              +---------+
       +--------------| ACTIONS |
       |              +---------+
       |                  |
       |                  +------------- > search_action.php
       |                  |
       |                  +------------- > add_action.php
       |                  |
       |                  +------------- > delete_action.php
       |                  |
       |                  +------------- > see-all.php
       |
       |              +-------+
       +--------------| PAGES |
       |              +-------+
       |                  |
       |                  +------------- > search_page.php
       |                  |
       |                  +------------- > add_page.php
       |                  |
       |                  +------------- > delete_page.php
       |                  |
       |                  +------------- > see-all.php
       |
       |              +-------+
       +--------------| FORMS |
       |              +-------+
       |                  |
       |                  +------------- > search_form
       |                  |
       |                  +------------- > add_form
       |                  |
       |                  +------------- > delete_form
       |                  |
       |                  +------------- > see-all_form
       | 
       |              +-------+
       +--------------| PAGES |
                      +-------+
                          |
                          +------------- > search.php
                          |
                          +------------- > add.php
                          |
                          +------------- > delete.php
                          |
                          +------------- > see-all.php
